/**
 * Substitution Variables
 */
jsx3.require("tibco.admin.enterpriseAssets.EnterpriseAssetsTabInterface");

jsx3.lang.Package.definePackage("tibco.admin.enterpriseAssets.subVars", function (subVars) {
});

/**
 * subVars
 */
jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.subVars.SubVarsPlugin",
        jsx3.lang.Object,
        [tibco.admin.enterpriseAssets.EnterpriseAssetsTabInterface],
        function (plugin) {
            plugin.instance = null;
			plugin.subVars = null;

            plugin.prototype.getNamespace = function() {
                return "tibco.admin";
            }

            plugin.prototype.destroyPlugin = function() {
            }

            plugin.prototype.initPlugin = function() {
            }

            plugin.getInstance = function(args) {
                if(!this.instance) {
                    tibco.admin.Main.loadClass("tibco/admin/enterpriseAssets/subVars/SubVars.js", "tibco.admin"); 	 
                    tibco.admin.Main.loadResource("tibco/admin/enterpriseAssets/subVars/jss/jss.xml", "tibco.admin", "jss31", "ljss", false);
                    this.instance = new tibco.admin.enterpriseAssets.subVars.SubVarsPlugin();
                }
                return this.instance;
            }

            plugin.prototype.getComponentPath = function() {
                return  "tibco/admin/enterpriseAssets/subVars/component.xml"
            }

            plugin.prototype.loadComponent = function(parent) {
                var me = this;
                tibco.admin.Main.loadUIResourceAsync(parent, this.getNamespace(), "tibco/admin/enterpriseAssets/subVars/ui/subVars.xml", me, me.componentLoaded);
            }

            plugin.prototype.componentLoaded = function(objEvent) {
                if(objEvent.status == "SUCCESS") {
					this.subVars = objEvent.obj;
					this.subVars.pluginObj = this;
					this.subVars.loadDetails();
                }
            }

            plugin.prototype.getTabText = function() {
                return tibco.admin.Main.getServer().getDynamicProperty("@@SubstitutionVariables_56L");
            }

        });
